app.service('z-role-s', [
		'$rootScope',
		'$z-http',
		'ZModel',
		function($rootScope, $http, ZModel) {
			var service = {
					getRoleList : function(data,success,fault) {
						$http.post("role/getRoleList.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					saveRole : function(data,success,fault) {
						$http.post("role/saveRole.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					updateRole : function(data,success,fault) {
						$http.post("role/updateRole.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					deleteRole : function(data,success,fault) {
						$http.post("role/deleteRole.do",
							$.param(data),
							{headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}}
							).success(function(data) {
								success(data.success);
			  				}).error(function(data) {
			  					if(fault) {
			  						fault(data);
			  				}
		  				});
					},
					getRoleListByEmployeeId : function(data,success,fault) {
						$http.post("role/getRoleListByEmployeeId.do",data)
						.success(function(data) {
							success(data.success);
		  				}).error(function(data) {
	  						fault(data);
		  				});
					},
					getRoleExport : function(success,fault){
						$http.post("role/getRoleExport.do")
						.success(function (date){
							success(date.success);
						}).error(function(date){
							fault(data);
						});
					}
			};
			return service;
		} ]);